%  Skew Tent mapping
clc
clear
alpha = rand();
gen = 300;
cx = rand();
result = [];

result(1) = cx;
for g = 2 : gen
    if 0 < cx && cx < alpha
        cx = cx / alpha;
    end
    if cx > alpha && cx < 1
        cx = (1 - cx) / (1 - alpha);
    end
    result(g) = cx;
end

plot(result)
    